<template>
  <div class="accountsettlementcity">
    <el-form :inline="true" class="demo-form-inline">
      <el-form-item label="征地项目：">
        <el-select v-model="value" value-key="Id" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.Id"
            :label="
              item.township +
              '--' +
              item.Village +
              '--' +
              item.YearNum +
              '--' +
              item.ProjectName +
              '--' +
              item.CreatFarmer +
              ' / ' +
              item.farmerAccount
            "
            :value="item.Id"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="已制单：">
        <el-select v-model="state1" placeholder="请选择">
          <el-option label="全部" value="1" />
          <el-option label="未申请" value="2" />
          <el-option label="未审核" value="3" />
          <el-option label="未制单" value="4" />
          <el-option label="未到账" value="5" />
          <el-option label="已到账" value="6" />
        </el-select>
      </el-form-item>
      <el-form-item label="申请单：">
        <el-select v-model="state2" placeholder="请选择"></el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="" class="el-icon-search" @click="onSubmit()"
          >查询</el-button
        >
      </el-form-item>
      <el-form-item>
        <el-button type="" class="el-icon-setting">提交</el-button>
      </el-form-item>
    </el-form>
    <!-- 支出申请表格 -->
    <div v-show="this.expapply">
      <el-table
        :header-cell-style="{ 'text-align': 'center' }"
        :cell-style="{ 'text-align': 'center' }"
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 1255px"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="name" label="姓名" width="120">
        </el-table-column>
        <el-table-column prop="address" label="身份证号" width="120px">
        </el-table-column>
        <el-table-column prop="name" label="结算金额" width="120">
        </el-table-column>
        <el-table-column prop="name" label="账户余额" width="120">
        </el-table-column>
        <el-table-column prop="name" label="备注" width="120">
        </el-table-column>
        <el-table-column prop="name" label="操作员" width="120">
        </el-table-column>
        <el-table-column prop="name" label="操作时间" width="120">
        </el-table-column>
        <el-table-column prop="name" label="审核时间" width="120">
        </el-table-column>
        <el-table-column prop="name" label="审核状态" width="120">
        </el-table-column>
        <el-table-column prop="name" label="到账时间" width="120">
        </el-table-column>
      </el-table>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage3"
        :page-size="100"
        layout="prev, pager, next, jumper"
        :total="this.tableData.length"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
import {
  API_FIN_LIST,
  API_FIN_APP,
  API_FIN_GET_BY,
  API_FIN_TOR,
} from "../../api/expenditure";
import { API_GET_LAND } from "../../api/table";
export default {
  name: "",
  data() {
    return {
      msg: "账户结算申请（城居保）",
      tableData: [],
      currentPage3: 1,
      expapply: false,
      state: "", // 状态
      state1: "", // 状态
      state2: "", // 状态
      value: "", // 征地项目
      options: [], // 征地项目数据
    };
  },
  methods: {
    onSubmit() {
      // if (this.value == "") {
      //   console.log("submit!!!");
      // } else {
      //   const timestart =
      //     this.value[0].getFullYear() +
      //     "-" +
      //     (this.value[0].getMonth() + 1) +
      //     "-" +
      //     this.value[0].getDate();
      //   const timeend =
      //     this.value[1].getFullYear() +
      //     "-" +
      //     (this.value[1].getMonth() + 1) +
      //     "-" +
      //     this.value[1].getDate();
      //   console.log(timestart); // 开始时间
      //   console.log(timeend); // 结束时间
      // }
      this.expapply = true;
      // 
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    /* 获取征地项目列表 */
    submitProjectName() {
      API_GET_LAND()
        .then((res) => {
          this.options = res.ResList;
          console.log(this.options);
          this.muoption = res.ResList;
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
  created() {
    this.submitProjectName();
  },
};
</script>

<style scoped lang="scss">
.accountsettlementcity {
  padding: 30px;
  .el-pagination {
    max-width: 1255px;
    text-align: right;
  }
}
</style>
